<script setup lang="ts">
import { setNavigationBarTitle, navigateBack, getCurrentInstance } from '@tarojs/taro';
import { Check as AppNutIconCheck } from '@nutui/icons-vue-taro';
import { onMounted } from 'vue';

const params = getCurrentInstance().router?.params as {
  title: string;
  from: string;
};
onMounted(() => {
  setNavigationBarTitle({
    title: `${params.title || '模版名称'}`,
  });
});
/**
 * 点击返回列表
 */
function backList() {
  if (params.from === 'edit') {
    navigateBack();
  } else {
    //印章申请 /pages/custom-approve-single/edit/index?title=用印申请&templateCodeList=e5730568-9eee-46b3-9919-0f69df0e0950&id=962394635484934144
    navigateBack({
      delta: 2,
    });
  }
}
</script>

<template>
  <view class="approve-submit-success app-page--1">
    <scroll-view class="app-page__wrapper" :scroll-y="true" :lower-threshold="100">
      <view class="approve-submit-success__header-wrapper">
        <app-nut-icon-check class="approve-submit-success__icon" />
      </view>
      <view>提交成功!</view>
    </scroll-view>
    <view class="approve-submit-success__footer">
      <nut-button block shape="round" type="info" @click="backList()"> 返回列表 </nut-button>
    </view>
  </view>
</template>

<style lang="scss">
@import './index.scss';
</style>
